<template>
  <div class="singer-album">
    <div class="album-wrap" v-for="(item,index) in album" :key="index">
      <div class="album-img">
        <img v-lazy="item.blurPicUrl" alt="">
      </div>
      <div class="album-song">
        <ul>
          <h3>{{item.name}}</h3>
          <li v-for="(item,indey) in albumList[index].songs" :key="indey" @click="playMusic(item)">
            <span class="top">{{indey+1}}</span>
            <span class="name">{{item.name}}</span>
            <span class="playtime">{{item.dt | formatDuration}}</span>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SingerAlbum',
  props: {
    album: {
      type: Array,
      default() {
        return []
      }
    },
    albumList: {
      type: Array,
      default() {
        return []
      }
    }
  }
}
</script>

<style lang="less" scoped>
.singer-album {
  .album-wrap {
    display: flex;
    margin: 20px 0;
    .album-img {
      width: 200px;
      height: 200px;
      img {
        width: 100%;
      }
    }
    .album-song {
      flex: 1;
      ul {
        margin: 0;
        margin-left: 20px;
        h3 {
          padding: 5px;
        }
        li {
          display: flex;
          align-items: center;
          padding: 8px 0;
          .top {
            flex: 1;
            margin: 0 8px;
          }
          &:hover {
            background: rgba(0, 0, 0, 0.1);
          }
          .playtime {
            flex: 1;
          }
          .name {
            flex: 12;
          }
        }
      }
    }
  }
}
</style>